package utils

// RemoveDuplicatesAndEmpty /**
func RemoveDuplicatesAndEmpty(addrs []int) []int {
	result := make([]int, 0, len(addrs))
	temp := map[int]struct{}{}
	for _, item := range addrs {
		if _, ok := temp[item]; !ok {
			temp[item] = struct{}{}
			result = append(result, item)
		}
	}
	return result
}

func SliceInterfaceToIntSlice(arg []interface{}) []int {
	into := make([]int, 0)
	for _, i2 := range arg {
		val, ok := i2.(float64)
		if !ok {
			continue
		}
		into = append(into, int(val))
	}
	return into
}
